## 在使用nodejs连接MySQL报错:

Client does not support authentication protocol requested by server; consider upgrading MySQL client
大概意思是:客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端

原因:

将mysql升级到5.x版本后,用客户端登录时出现了 Client does not support authentication protocol requested by server错误,是由于新旧版本的mysql的密码算法不同引起

解决方法如下:

登录mysql,输入如下命令即可。

1
2
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
flush privileges;

这样就能解决这个问题了。
在这里插入图片描述